package vip.xiaomoli.validator.util;

import vip.xiaomoli.validator.model.Api;

public class Checker {

    public static boolean isExists (Api api, Object param) {
        Object result = SpringBeanUtil.genericInvoke(api.getApiClass(), api.getMethodName(), param);
        if (result instanceof Boolean) {
            return (boolean) result;
        } else {
            throw new RuntimeException("The return value must be boolean！");
        }
    }

}
